package com.qfedu.controller;

import com.qfedu.entity.AskForLeave;
import com.qfedu.entity.ResponseData;
import com.qfedu.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/AskForLeave")
public class AskForLeaveController {




    @RequestMapping("/insertLeave.do")
    public ResponseData askForLeave(AskForLeave askForLeave, HttpServletRequest request){

        System.out.println("askForLeave；"+askForLeave);

        // 获取 当前用户 user
       User user = (User) request.getSession().getAttribute("user");
       askForLeave.setUid(user.getId());


       // 保存 user  自己完成
       ResponseData responseData = new ResponseData();

       responseData.setCode(0);// 0 代表
       responseData.setMsg("success");

        return responseData;
    }

}
